import { StoreModule } from '@/plugins/store-decorators';
import 'reflect-metadata'


@StoreModule()
class SmallItem {

    constructor() { }

    name: string = "small";
    count = 1;

    set addCount(x: number) {
        this.count += x;
    }

    async run() {
        this.addCount = 2;
        //await new Promise(resolve => setTimeout(resolve, 1000));
        return this.name + "_" + this.count;
    }
}

@StoreModule()
export class AppTest {

    private name: string = "test";

    _desc?: string = "desc";

    Small: SmallItem = new SmallItem();

    get full() { return `${this.name} | ${this._desc}`; }

    set new_name(n: string) {
        this.name = n;
    }
    set new_desc(n: string) {
        this._desc = n;
    }

    async readName() {
        return this.name;
    }
}

